/**
* All Rights Reserved , Copyright (C) 2021 , 青岛鼎信通讯股份有限公司
*
* SdProjectHistoryServiceAuto
* SD项目立项-历史表
*
* 修改纪录
* 2021-12-08 版本：1.0 wangxinhua 创建。
* @version 版本：1.0
* @author 作者：wangxinhua
* 创建日期：2021-12-08
*/

package com.topscomm.gpm.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;
import java.util.Map;
import com.topscomm.gpm.*;
import com.topscomm.gpm.pojo.GpmProjectHistoryEntity;
import com.topscomm.gpm.dao.IGpmProjectHistoryDao;


public class GpmProjectHistoryServiceAuto extends GpmService<GpmProjectHistoryEntity, IGpmProjectHistoryDao> {

	/**
	 * @author: wangxinhua
	 * @date: 2021-12-08
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("sourcetype") != null) {
			temp = mapRow.get("sourcetype").toString();
			mapRow.put("dispsourcetype", datacodeCache.getValueDynamic("GpmProjectSource", temp, "code", "name"));
		}
		if (mapRow.get("projectlevel") != null) {
			temp = mapRow.get("projectlevel").toString();
			mapRow.put("dispprojectlevel", datacodeCache.getValueDynamic("GpmProjectLevel", temp, "code", "name"));
		}
		if (mapRow.get("clientlevel") != null) {
			temp = mapRow.get("clientlevel").toString();
			mapRow.put("dispclientlevel", datacodeCache.getValueDynamic("GpmClientLevel", temp, "code", "name"));
		}
		if (mapRow.get("outcontractable") != null) {
			temp = mapRow.get("outcontractable").toString();
			mapRow.put("dispoutcontractable", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("deptcommoncode1") != null) {
			temp = mapRow.get("deptcommoncode1").toString();
			mapRow.put("dispdeptcommoncode1", datacodeCache.getValueDynamic("DeptCommonCode", temp, "code", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("open") != null) {
			temp = mapRow.get("open").toString();
			mapRow.put("dispopen", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("projectstate") != null) {
			temp = mapRow.get("projectstate").toString();
			mapRow.put("dispprojectstate", datacodeCache.getValueDynamic("GpmProjectState", temp, "code", "name"));
		}
		if (mapRow.get("abnormalstate") != null) {
			temp = mapRow.get("abnormalstate").toString();
			mapRow.put("dispabnormalstate", datacodeCache.getValueDynamic("GpmProjectAbnormalState", temp, "code", "name"));
		}
		if (mapRow.get("projecttype") != null) {
			temp = mapRow.get("projecttype").toString();
			mapRow.put("dispprojecttype", datacodeCache.getValueDynamic("GpmProjectType", temp, "code", "name"));
		}
		if (mapRow.get("sdrange") != null) {
			temp = mapRow.get("sdrange").toString();
			mapRow.put("dispsdrange", datacodeCache.getValueDynamic("GpmRange", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "sdProjectHistoryDao")
	public void setDao(IBasicDao<GpmProjectHistoryEntity> dao) {
		super.setDao(dao);
	}
}
